package com.recharge.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.recharge.plugins.PermissionPlugins;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;

@Configuration
public class MybatisPlusConfig {


    /*@Bean
    public PermissionPlugins permissionPlugins(){
        PermissionPlugins permissionPlugins = new PermissionPlugins();
        return permissionPlugins;
    }*/
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor page = new PaginationInterceptor();
        page.setOverflow(true);
        return page;
    }

    /**
     * 乐观锁插件
     */
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }

}
